<?php
class movie
{
	var $id = '';
	var $name = '';
	var $director = '';
	var $actors = '';
	
	var $release_time = '';
	var $star = '';
	var $image_list = '';
	
	function __construct($item)
	{
		if(check_array($item))
		{
			$this->id = isset($item['id']) ? $item['id'] : '';
			$this->name = isset($item['name']) ? $item['name'] : '';
			$this->director = isset($item['director']) ? $item['director'] : '';
			
			if(isset($item['actors']) && check_array($item['actors']))
			{
				$temp = array();
				foreach($item['actors'] as $actor)
				{
					$temp[] = $actor['actor_name'];
					/*
					$temp['actor_id'] = $actor['id'];
					$temp['actor_name'] = $actor['actor_name'];
					$temp['actor_name_en'] = $actor['actor_name_en'];
					$temp['gender'] = $actor['gender'];
					$temp['is_main'] = $actor['is_main'];
					*/
				}
				$this->actors = implode(', ', $temp);
			}
			
			$this->release_time = isset($item['release_date']) ? date('Y-m-d', $item['release_date']) : '';
			$this->star = isset($item['star_level']) ? $item['star_level'] : '';
			$this->image_list = isset($item['image_list']) ? $item['image_list'] : array();
		}
	}
	
}
/*
“moveId”:”电影Id”,
“moveName”:”电影名称”,  
“moveDirector”:”导演名称”,  
“personators”:”主演人员”,  
“releaseTime”:”上映时间”,
“starGrade”:”星级别数”,//add new
“moveImageURL”:”http：//.…”,
*/ 